package com.shawn.example.mvvmdemo.home.repository

import com.jetpack.mvvm.lib.net.ServiceCreators
import com.jetpack.mvvm.lib.net.module.HttpApiResult
import com.shawn.example.mvvmdemo.home.model.WxAuthor
import com.shawn.example.mvvmdemo.home.net.api.WXApiService
import com.shawn.example.mvvmdemo.home.vo.FeedArticleListData
import dagger.hilt.android.scopes.ActivityRetainedScoped
import dagger.hilt.android.scopes.FragmentScoped
import javax.inject.Inject

class WXRepository @Inject constructor() {
    private val service = ServiceCreators.create(WXApiService::class.java)

    suspend fun getWxAuthorList(): HttpApiResult<List<WxAuthor>> {
        return service.getWXAuthorList()
    }

    suspend fun getWxArticlesList(id: Int, page: Int): HttpApiResult<FeedArticleListData> {
        return service.getWxAuthorArticles(id, page)
    }
}